package work.mediway.mdm.biz.service.hierarchy;

import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

import work.mediway.mdm.core.page.QueryRequest;
import work.mediway.mdm.core.transport.ErrorMsgVO;
import work.mediway.mdm.biz.entity.hierarchy.HosOrganization;

/**
 * <p>
 * 组织机构树 服务类
 * </p>
 *
 * @author ruoyi
 * @since 2022-08-25
 */
public interface HosOrganizationService extends IService<HosOrganization> {

    /**
     * 新增组织
     *
     * @param hosOrganization HosOrganization
     * @return ErrorMsgVO
     */
    ErrorMsgVO saveHosOrganization(HosOrganization hosOrganization);

    /**
     * 查询组织
     *
     * @param hosOrganization HosOrganization
     * @param tree            boolean
     * @param queryRequest    QueryRequest
     * @return Object
     */
    Object findHosOrganization(HosOrganization hosOrganization, boolean tree, QueryRequest queryRequest);

    /**
     * 查询指定组织下的所有子节点
     *
     * @param currentHosOrganizationCode String
     * @param containsCurrent            boolean
     * @param tree                       boolean
     * @return List<DeHierarchy>
     */
    Object findChildrenHosOrganization(String currentHosOrganizationCode, boolean containsCurrent, boolean tree);

    /**
     * 更新组织
     *
     * @param hosOrganization HosOrganization
     */
    void updateHosOrganization(HosOrganization hosOrganization);

    /**
     * 删除组织
     *
     * @param orgCode     String
     * @param deleteChild boolean
     * @return ErrorMsgVO
     */
    ErrorMsgVO deleteHosOrganization(String orgCode, boolean deleteChild);

    /**
     * 导入组织
     *
     * @param hosOrganizations List<HosOrganization>
     * @param updateSupport    boolean
     * @return
     */
    ErrorMsgVO importHosOrganization(List<HosOrganization> hosOrganizations, boolean updateSupport);
}
